-- GENERATED SPELL FOR [Dalaran Summoner] --


function spell0_2358(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(20815,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2358', 3000, 1)
end

function spell1_2358(pUnit, Event) --@Summon Shield Guard,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(3655,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_2358', 1, 1)
end

function spell2_2358(pUnit, Event) --@Summon Theurgist,Self--
pUnit:FullCastSpellOnTarget(3658,pUnit)
pUnit:RegisterEvent('Sorts_2358', 35000, 1)
end

function Sorts_2358(pUnit, Event)
local choix_sorts_2358 = math.random(0, 2)
if choix_sorts_2358 == 0 then
pUnit:RegisterEvent('spell0_2358', 1, 1)
end
if choix_sorts_2358 == 1 then
pUnit:RegisterEvent('spell1_2358', 1, 1)
end
if choix_sorts_2358 == 2 then
pUnit:RegisterEvent('spell2_2358', 1, 1)
end
end

function mob2358_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2358', math.random(1500, 3000), 1)
end

function mob2358_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2358_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2358_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2358, 1, 'mob2358_Action')
RegisterUnitEvent(2358, 2, 'mob2358_Leave')
RegisterUnitEvent(2358, 3, 'mob2358_Kill')
RegisterUnitEvent(2358, 4, 'mob2358_Die')
